package cn.jaye.fabric.infrastructure.mybatis.impl;

import cn.jaye.fabric.domain.model.Match;
import cn.jaye.fabric.infrastructure.mybatis.impl.mapper.MatchMapper;
import com.alibaba.fastjson.JSONArray;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author Jaye
 * @create 2018-06-04 14:41
 */
@Repository
@EnableAspectJAutoProxy(proxyTargetClass = true)
public class MatchRepositoryImpl extends ServiceImpl<MatchMapper, Match> {
    @Autowired
    private MatchMapper matchMapper;

    public List<Match> listEndMatch() {
        return matchMapper.listEndMatch();
    }

    public JSONArray listMatchByUserAndDate(Long guessCountDownTime, String username, String startDate, String endDate) {
        return matchMapper.listMatchByUserAndDate(guessCountDownTime, username, startDate, endDate);
    }

    public JSONArray listMatchByDate(String startDate, String endDate) {
        return matchMapper.listMatchByDate(startDate, endDate);
    }

    public JSONArray listAll() {
        return matchMapper.listAll();
    }
}
